using System.ComponentModel.Composition.Hosting;
using System.Reflection;
using MefContrib.Models.Provider.Definitions.Attributed;
using NUnit.Framework;

namespace MefContrib.Models.Provider.Tests.Definitions
{
    [TestFixture]
    public class AttributedDefinitionProviderTests : DefinitionProviderTests
    {
        private readonly CompositionContainer _container;

        public AttributedDefinitionProviderTests()
        {
            var assembly = Assembly.GetExecutingAssembly();
            var provider = new AttributedDefinitionProvider(assembly);
            var catalog = new DefinitionProviderPartCatalog<AttributedDefinitionProvider>(provider);
            var assemblyCatalog = new AssemblyCatalog(assembly);
            var aggregateCatalog = new AggregateCatalog(catalog, assemblyCatalog);
            var container = new CompositionContainer(aggregateCatalog);

            _container = container;
        }

        protected override CompositionContainer Container
        {
            get { return _container; }
        }
    }
}